<?php

namespace App\Http\Requests\Wechat;

use App\Http\Requests\ApiRequest;
use Illuminate\Foundation\Http\FormRequest;

/**
 * @property string customer_id
 * @property string openid
 * @property string store_id
 * @property string skin_detector_id
 */
class SkinRecordListRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'openid'           => 'required|string',
//            'appid'            => 'required|string',
            'skin_detector_id' => 'required|in:2,3',
            'customer_id'      => 'nullable|int|min:1',
            'store_id'         => 'nullable|int|min:1',
        ];
    }

    /**
     * @return array
     */
//    public function messages()
//    {
//        return [
//            'openid.*'           => '微信用户的openid必须是字符串',
//            'appid.*'            => '公众号的appid必须是字符串',
//            'skin_detector_id.*' => '肤质类型必须是2或3',
//            'customer_id.*'      => '客户编号必须是数字',
//            'store_id.*'         => '店铺编号必须是数字',
//        ];
//    }
}
